package org.middleware.dao.system;

import org.middleware.entity.system.SysMenus;
import org.middleware.mapper.system.SysMenusMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysMenusDao {
    @Autowired
    private SysMenusMapper menusMapper;

    public List<SysMenus> getMenusBySysAndParent(int system_id, int parent_id, String name) {
        return menusMapper.getMenusBySysParent(system_id, parent_id, name);
    }

    public int create(SysMenus menu) {
        return menusMapper.create(menu);
    }

    public int update(SysMenus menu) {
        return menusMapper.update(menu);
    }

    public int delete(int id) {
        return menusMapper.delete(id);
    }

    public int deleteAllSubMenus(List<Integer> list) {
        return menusMapper.deleteAllSubmenus(list);
    }
}
